package com.education.welco.service.impl;


import com.education.common.utils.Convert;
import com.education.welco.mapper.LPaperMapper;
import com.education.welco.pojo.LPaper;
import com.education.welco.service.ILPaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 试卷 服务层实现
 *
 * @author d
 * @date 2020-05-08
 */
@Service
public class LPaperServiceImpl implements ILPaperService {

    @Autowired
    private LPaperMapper lPaperMapper;

    /**
     * 查询试卷信息
     *
     * @param id 试卷ID
     * @return 试卷信息
     */
    @Override
    public LPaper selectLPaperById(Integer id) {
        return lPaperMapper.selectLPaperById(id);
    }

    /**
     * 查询试卷列表
     *
     * @param lPaper 试卷信息
     * @return 试卷集合
     */
    @Override
    public List<LPaper> selectLPaperList(LPaper lPaper) {
        return lPaperMapper.selectLPaperList(lPaper);
    }

    /**
     * 新增试卷
     *
     * @param lPaper 试卷信息
     * @return 结果
     */
    @Override
    public int insertLPaper(LPaper lPaper) {
        return lPaperMapper.insertLPaper(lPaper);
    }

    /**
     * 删除试卷信息
     *
     * @param id 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLPaperById(Integer id) {
        return lPaperMapper.deleteLPaperById(id);
    }

    /**
     * 修改试卷
     *
     * @param lPaper 试卷信息
     * @return 结果
     */
    @Override
    public int updateLPaper(LPaper lPaper) {
        return lPaperMapper.updateLPaper(lPaper);
    }

    /**
     * 删除试卷对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLPaperByIds(String ids) {
        return lPaperMapper.deleteLPaperByIds(Convert.toStrArray(ids));
    }
}